/**
 * 
 */
package ar.com.sebasoft.prestalibro.view.activity;

import android.app.Activity;
import android.os.Bundle;
import ar.com.sebasoft.prestalibro.view.util.SessionInViewManager;

/**
 * @author SebaSOFT
 * 
 */
public abstract class BaseActivity extends Activity {

	private SessionInViewManager sessionManager = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.initializeSession();
	}

	/**
	 * 
	 */
	private void initializeSession() {
		if (this.sessionManager == null) {
			this.sessionManager = SessionInViewManager.getInstance(this.getApplicationContext());
		}
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		this.sessionManager.close();
	}

	public SessionInViewManager getSession() {
		this.initializeSession();
		return this.sessionManager;
	}
}
